package com.test05.anotation1;

import java.lang.reflect.Proxy;
import java.util.Properties;

@SuppressWarnings("unchecked")
public class PropertyTool {

	private PropertyTool() {
	}

	public static <T> T bindProperties(Class<T> clazz, Properties properties) {
		return (T) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] { clazz },
				new PropertyInvokationHandler(properties));
	}
}